<template>
	<div>
		<button @click="getStudentInfo">点我获取学生数据</button>
		<button @click="getCarInfo">点我获取汽车数据</button>
	</div>
</template>

<script>
	import axios from 'axios';
	export default {
		name:'App',
		methods:{
			getStudentInfo(){
				axios.get('http://localhost:8080/demo/students').then(
					response => {
						console.log('请求成功',response.data)
					},
					error => {
						console.log('请求失败',error)
					}
				)
			},
			getCarInfo(){
				axios.get('http://localhost:8080/test/cars').then(
					response => {
						console.log('请求成功',response.data)
					},
					error => {
						console.log('请求失败',error)
					}
				)
			}
		}
	}
</script>
